package com.zdxc.service;


import com.zdxc.entities.Codezyz;
import com.zdxc.entities.Codezyz;
import common.bean.Paging;
import common.dao.BaseMyBatisDAO;
import common.util.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;

/**
 * 用户服务类
 */
@Lazy
@Service
public class ZyzService {
    @Autowired
    BaseMyBatisDAO baseMyBatisDAO;
    private static final String SQL_NS = "com.zdxc.dao.Codezyz.";

    public Paging findByCondition(Codezyz zyzinfo, Paging paging) {
        paging.setStringParams(zyzinfo);

        paging = baseMyBatisDAO.findForPageHelper(SQL_NS + "findByCondition", paging);

        return paging;
    }

    /**
     * 根据ID查询数据采集表
     *
     * @param zyzId
     * @return codezyzEntity
     */
    public Codezyz findByKey(String zyzId){
        return baseMyBatisDAO.findUnique(SQL_NS +"selectByPrimaryKey", zyzId);
    }




    /**
     * 插入专业组信息
     * @param zyzinfo
     * @return int
     */
    public int insert(Codezyz zyzinfo){
        zyzinfo.setZyzId(StringUtils.getUUID()); //生成主键
        return baseMyBatisDAO.insert(SQL_NS +"insertSelective", zyzinfo);
    }


    /**
     * 更新专业组信息
     *
     */
    public int update(Codezyz zyzinfo)
    {
      int result  =   baseMyBatisDAO.update(SQL_NS+"updateByPrimaryKeySelective",zyzinfo);
      return result;
    }



}
